package com.htht.job.core.util;

import org.jeesys.common.jpa.entity.UUIDEntity;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author zhushunfu <br />
 * @create_time 2017年7月24日 下午9:19:39 <br />
 * @todo 
 */
@SuppressWarnings("serial")
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity extends UUIDEntity {

	@Temporal(TemporalType.TIMESTAMP)
	@CreatedDate
	@Column(nullable=false)
	private Date createTime;

	@Temporal(TemporalType.TIMESTAMP)
	@LastModifiedDate
	private Date updateTime;
	
	@Version
	private Integer version;

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}
}
